//
//  HMSinaPictureViewCollectionCell.swift
//  ZJCSina
//
//  Created by 朱建超 on 16/11/19.
//  Copyright © 2016年 itHeiMa. All rights reserved.
//

import UIKit

class HMSinaPictureViewCollectionCell: UICollectionViewCell {
    
    @IBOutlet weak var gifImage: UIImageView!
    
    @IBOutlet weak var pictureView: UIImageView!
    
    var picturesInfo : HMSinaPictures?{
    
        didSet{
        
            //设置URL
//            let urlString = URL(string: picturesInfo?.thumbnail_pic ?? "")
            
            pictureView.sd_setImage(with: picturesInfo?.imageURL)
            
            //设置gif的显示和隐藏
            if (picturesInfo?.thumbnail_pic?.hasSuffix(".gif"))! {
                
                self.gifImage.isHidden = false
                
            }else{
            
                self.gifImage.isHidden = true
            }
        }
    
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

}
